package com.hit.aircraftwar.creator;


import com.hit.aircraftwar.basic.AbstractFlyingObject;
import com.hit.aircraftwar.setter.ParameterSet;
import com.hit.aircraftwar.supply.HpSupply;

/**
 * @author LiuYuZhe
 */
public class HpSupplyCreator implements Creator {

    /**
     * 生命道具默认基础参数
     */
    private final int effect = 500;

    @Override
    public AbstractFlyingObject creatObject(int locationX, int locationY) {
        int fixedEffect;
        if(ParameterSet.INSTANCE.hpDouble) {
            fixedEffect = this.effect * 2;
        } else {
            fixedEffect = this.effect;
        }
        return new HpSupply(
                locationX,
                locationY,
                fixedEffect
        );
    }

    @Override
    public AbstractFlyingObject creatObject() {
        int fixedEffect;
        if(ParameterSet.INSTANCE.hpDouble) {
            fixedEffect = this.effect * 2;
        } else {
            fixedEffect = this.effect;
        }
        return new HpSupply(
                0,
                0,
                fixedEffect
        );
    }
}
